/*    */ package com.zimbra.cs.client.soap;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.DomUtil;
/*    */ import com.zimbra.common.soap.MailConstants;
/*    */ import com.zimbra.common.soap.SoapParseException;
/*    */ import com.zimbra.cs.client.LmcContact;
/*    */ import com.zimbra.cs.client.LmcContactAttr;
/*    */ import org.dom4j.DocumentHelper;
/*    */ import org.dom4j.Element;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class LmcCreateContactRequest
/*    */   extends LmcSoapRequest
/*    */ {
/*    */   private LmcContact mContact;
/*    */   
/* 40 */   public void setContact(LmcContact c) { this.mContact = c; }
/*    */   
/* 42 */   public LmcContact getContact() { return this.mContact; }
/*    */   
/*    */   protected Element getRequestXML() throws LmcSoapClientException {
/* 45 */     Element request = DocumentHelper.createElement(MailConstants.CREATE_CONTACT_REQUEST);
/* 46 */     Element newCN = DomUtil.add(request, "cn", "");
/* 47 */     LmcSoapRequest.addAttrNotNull(newCN, "l", this.mContact.getFolder());
/* 48 */     LmcSoapRequest.addAttrNotNull(newCN, "t", this.mContact.getTags());
/*    */     
/*    */ 
/* 51 */     LmcContactAttr[] attrs = this.mContact.getAttrs();
/* 52 */     for (int i = 0; (attrs != null) && (i < attrs.length); i++) {
/* 53 */       addContactAttr(newCN, attrs[i]);
/*    */     }
/* 55 */     return request;
/*    */   }
/*    */   
/*    */   protected LmcSoapResponse parseResponseXML(Element responseXML)
/*    */     throws SoapParseException, ServiceException, LmcSoapClientException
/*    */   {
/* 61 */     LmcCreateContactResponse response = new LmcCreateContactResponse();
/* 62 */     LmcContact c = parseContact(DomUtil.get(responseXML, "cn"));
/* 63 */     response.setContact(c);
/* 64 */     return response;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/client/soap/LmcCreateContactRequest.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */